package com.yonyou.brigade.facade.service.impl;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yonyou.brigade.facade.service.IReportService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class ReportServiceImpl implements IReportService {

    @Value("${brigade.url.projecturl}")
    private String BRIGADE_URL;

    @Override
    public List getReportUrl(String tenantId) {
        String reportId = "";
        JSONArray result = new JSONArray();
        JSONObject jsonObject1 = new JSONObject();
        jsonObject1.put("name", "日报表统计");
        jsonObject1.put("key", "AirDay");
        reportId = "dadce4fc-2ad8-4772-84f2-c7972aeb45f1";
        jsonObject1.put("url", "https://intelliv.diwork.com/#/analysis/" + reportId + "?hb=share,edit,print,close,case,a_change,a_edit,g_setting&locale=zh_CN&systenant=YBZ&diwork=false&tenant_id=" + tenantId + "&webmodel_url=" + BRIGADE_URL + "/report/api/v1");

        JSONObject jsonObject2 = new JSONObject();
        jsonObject2.put("name", "航线票量统计");
        jsonObject2.put("key", "AirRoute");
        reportId = "f2b67ea7-7df3-44d6-a169-3cd2f4d078e4";
        jsonObject2.put("url", "https://intelliv.diwork.com/#/analysis/" + reportId + "?hb=share,edit,print,close,case,a_change,a_edit,g_setting&locale=zh_CN&systenant=YBZ&diwork=false&tenant_id=" + tenantId + "&webmodel_url=" + BRIGADE_URL + "/report/api/v1");

        JSONObject jsonObject3 = new JSONObject();
        jsonObject3.put("name", "正常票和退票对比");
        jsonObject3.put("key", "AirRefund");
        reportId = "3eeaef7a-3609-4616-91a7-e11d5b866c83";
        jsonObject3.put("url", "https://intelliv.diwork.com/#/analysis/" + reportId + "?hb=share,edit,print,close,case,a_change,a_edit,g_setting&locale=zh_CN&systenant=YBZ&diwork=false&tenant_id=" + tenantId + "&webmodel_url=" + BRIGADE_URL + "/report/api/v1");

        JSONObject jsonObject4 = new JSONObject();
        jsonObject4.put("name", "提前预订天数分析");
        jsonObject4.put("key", "AirAdvance");
        reportId = "3aa1d6a1-bc93-40d3-acac-38a5f78405b6";
        jsonObject4.put("url", "https://intelliv.diwork.com/#/analysis/" + reportId + "?hb=share,edit,print,close,case,a_change,a_edit,g_setting&locale=zh_CN&systenant=YBZ&diwork=false&tenant_id=" + tenantId + "&webmodel_url=" + BRIGADE_URL + "/report/api/v1");

        JSONObject jsonObject5 = new JSONObject();
        jsonObject5.put("name", "航司票量分析");
        jsonObject5.put("key", "AirLineTicket");
        reportId = "9172399f-81e0-4e92-9e1c-3bf514927c5e";
        jsonObject5.put("url", "https://intelliv.diwork.com/#/analysis/" + reportId + "?hb=share,edit,print,close,case,a_change,a_edit,g_setting&locale=zh_CN&systenant=YBZ&diwork=false&tenant_id=" + tenantId + "&webmodel_url=" + BRIGADE_URL + "/report/api/v1");

        JSONObject jsonObject6 = new JSONObject();
        jsonObject6.put("name", "折扣率分析");
        jsonObject6.put("key", "AirDiscount");
        reportId = "6b6893b0-7fc8-4977-84e6-5e366bb39372";
        jsonObject6.put("url", "https://intelliv.diwork.com/#/analysis/" + reportId + "?hb=share,edit,print,close,case,a_change,a_edit,g_setting&locale=zh_CN&systenant=YBZ&diwork=false&tenant_id=" + tenantId + "&webmodel_url=" + BRIGADE_URL + "/report/api/v1");

        JSONObject jsonObject7 = new JSONObject();
        jsonObject7.put("name", "未选最低价原因统计");
        jsonObject7.put("key", "AirUnselectLowestReason");
        reportId = "db18371f-69dc-4d44-af71-393cbef1682f";
        jsonObject7.put("url", "https://intelliv.diwork.com/#/analysis/" + reportId + "?hb=share,edit,print,close,case,a_change,a_edit,g_setting&locale=zh_CN&systenant=YBZ&diwork=false&tenant_id=" + tenantId + "&webmodel_url=" + BRIGADE_URL + "/report/api/v1");

        JSONObject jsonObject8 = new JSONObject();
        jsonObject8.put("name", "员工订票排名");
        jsonObject8.put("key", "AirBookRank");
        reportId = "bd57b41c-2883-43c3-ab71-ffccc3221c4a";
        jsonObject8.put("url", "https://intelliv.diwork.com/#/analysis/" + reportId + "?hb=share,edit,print,close,case,a_change,a_edit,g_setting&locale=zh_CN&systenant=YBZ&diwork=false&tenant_id=" + tenantId + "&webmodel_url=" + BRIGADE_URL + "/report/api/v1");

        JSONObject jsonObject9 = new JSONObject();
        jsonObject9.put("name", "个人订票分析");
        jsonObject9.put("key", "AirPersonBook");
        reportId = "0e7d9576-198e-431a-9aeb-34d01e2d051e";
        jsonObject9.put("url", "https://intelliv.diwork.com/#/analysis/" + reportId + "?hb=share,edit,print,close,case,a_change,a_edit,g_setting&locale=zh_CN&systenant=YBZ&diwork=false&tenant_id=" + tenantId + "&webmodel_url=" + BRIGADE_URL + "/report/api/v1");

        JSONArray jsonArray = new JSONArray();
        jsonArray.add(jsonObject1);
        jsonArray.add(jsonObject2);
        jsonArray.add(jsonObject3);
        jsonArray.add(jsonObject4);
        jsonArray.add(jsonObject5);
        jsonArray.add(jsonObject6);
        jsonArray.add(jsonObject7);
        jsonArray.add(jsonObject8);
        jsonArray.add(jsonObject9);
        JSONObject resultPlane = new JSONObject();
        resultPlane.put("name", "飞机");
        resultPlane.put("key", "PLANE");
        resultPlane.put("defaultActiveKey", "report1");
        resultPlane.put("list", jsonArray);

        /*JSONObject jsonObject11 = new JSONObject();
        jsonObject11.put("name", "报表1");
        jsonObject11.put("key", "Train");
        jsonObject11.put("url", "https://acc.yonyoucloud.com/fireport/client/#/view/AirDay/ybz/{tenantId}/userid={userId}");
        JSONObject jsonObject12 = new JSONObject();
        jsonObject12.put("name", "报表2");
        jsonObject12.put("key", "Train2");
        jsonObject12.put("url", "https://acc.yonyoucloud.com/fireport/client/#/view/AirDay/ybz/{tenantId}/userid={userId}");
        JSONArray jsonArray2 = new JSONArray();
        jsonArray2.add(jsonObject11);
        jsonArray2.add(jsonObject12);
        JSONObject resultTrain = new JSONObject();
        resultTrain.put("name", "火车");
        resultTrain.put("key", "Train");
        resultTrain.put("defaultActiveKey", "report2");
        resultTrain.put("list", jsonArray2);*/

        result.add(resultPlane);
        /*result.add(resultTrain);*/
        return result;
    }
}
